package cn.com.zpark.servlet_response;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @PackageName: cn.com.zpark.servlet_response
 * @ClassName: ResponseDemo03
 * @Description:
 * @author: RZS
 * @date: 2021/11/14  16:58
 */
@WebServlet("/rd3.jsp")
public class ResponseDemo03 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 设置响应头字段信息
        response.addHeader("name", "zhangsan");
        response.setHeader("DC", "大锤");

        response.getWriter().write("<h1>设置响应头字段信息</h1>");
    }
}
